import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 教练证书信息 */
export interface CoachCertificate {
          id: number; // ID
          coachId?: number; // 教练ID
          name?: string; // 证书名称
          image?: string; // 证书图片
          auditStatus?: number; // 审核状态（字典：business_audit_status）
  }

// 教练证书 API
export const CoachCertificateApi = {
  // 查询教练证书分页
  getCoachCertificatePage: async (params: any) => {
    return await request.get({ url: `/business/coach-certificate/page`, params })
  },

  // 查询教练证书详情
  getCoachCertificate: async (id: number) => {
    return await request.get({ url: `/business/coach-certificate/get?id=` + id })
  },

  // 新增教练证书
  createCoachCertificate: async (data: CoachCertificate) => {
    return await request.post({ url: `/business/coach-certificate/create`, data })
  },

  // 修改教练证书
  updateCoachCertificate: async (data: CoachCertificate) => {
    return await request.put({ url: `/business/coach-certificate/update`, data })
  },

  // 删除教练证书
  deleteCoachCertificate: async (id: number) => {
    return await request.delete({ url: `/business/coach-certificate/delete?id=` + id })
  },

  /** 批量删除教练证书 */
  deleteCoachCertificateList: async (ids: number[]) => {
    return await request.delete({ url: `/business/coach-certificate/delete-list?ids=${ids.join(',')}` })
  },

  // 导出教练证书 Excel
  exportCoachCertificate: async (params) => {
    return await request.download({ url: `/business/coach-certificate/export-excel`, params })
  },
}